{include file="common/head"}
<div class="tab-area-plh">
        <div class="tab-area">
            <div class="wrapper">
                <div class="cate-area">
                    <a class="cate-item jxtj {eq name='alias' value='index'}active{/eq}" href="{:get_config('WEB_SITE_URL')}">
                        <span class="cate-rec">精选推荐</span>
                    </a>
                    {nav name='nav'}
                    <a href="{$nav.link|nav_url}" class="cate-item {eq name='nav.alias' value='$alias'}active{/eq}" {eq name="nav.target" value="1"}target="_blank"{/eq}>
                        {$nav['name']}
                    </a>
                    {/nav}
                </div>
            </div>
        </div>
    </div>
</div>
<div class="wrapper zk-detail">
    <div class="wrapper-l zk-main">
        <p class="bread-area">
            您的位置：<a href="{:get_config('WEB_SITE_URL')}">{:get_config('WEB_SITE_NAME')}</a> &nbsp;&gt;&nbsp;<a href="{:url('Cate/index',['id'=>$goods['cid']])}">{$cate[$goods['cid']]}</a></span>&nbsp;&gt;&nbsp;{$goods['title']}
        </p>
        <div class="zk-content">
            <div class="img-area">
                <img src="{$goods['img']}" alt="{$goods['title']}">
            </div>
            <div class="info-area">
                <h1 class="title elli">
                    <span>包邮</span>{$goods['title']}
                </h1>
                <p class="endtime" id="eventTimeStr">优惠券即将失效:<em></em>天<em></em>时<em></em>分<em></em>秒</p>
                <input id="endTime" value="{$goods.end_time}" type="hidden">
                <script type="text/javascript">
                    $(function(){
                        var timeArea = $('#eventTimeStr');
                        var endTime = $('#endTime').val();
                        setInterval(dateCountDown,1000);
                        function dateCountDown(){
                            var now = Math.floor(new Date().getTime()/1000)*1;
                            if(now > endTime){
                                timeArea.html('优惠券已失效');
                            }else{
                                var gap = endTime - now;
                                var dd = Math.floor(gap/(60*60*24));
                                var hh = Math.floor((gap-dd*60*60*24)/(60*60));
                                var mm = Math.floor((gap-dd*60*60*24-hh*60*60)/60);
                                var ss = gap-dd*60*60*24-hh*60*60-mm*60;
                                var timeStr = '优惠券即将失效:&nbsp;'
                                        +(dd>0?'<em>'+dd+'</em>天':'')
                                        +(hh>0?'<em>'+hh+'</em>时':'')
                                        +(mm>0?'<em>'+mm+'</em>分':'')
                                        +(ss>=0?'<em>'+ss+'</em>秒':'');
                                timeArea.html(timeStr);
                            }
                        }
                    });
                </script>

                <div class="platform">
                    {switch name="$goods['shop_type']"}
                        {case value="C"}
                        <i style="background-image: url(__STATIC__/images/platform_taobao.png);"></i>
                        淘宝
                        {/case}
                        {case value="B"}
                         <i style="background-image: url(__STATIC__/images/platform_tmall.png);"></i>
                        天猫
                        {/case}
                        {/switch}
                </div>
                <div class="stat">
                    <p class="price-area">
                        <span class="ori-price">现价：¥{$goods['price']|format_number}</span>
                        <span class="price"><i>券后价</i><em class="decimal">¥</em><em class="int">{$goods['discount_price']|format_number}</em></span>
                    </p>
                    <div class="buy-area">
                        <p class="desc">有效期内领券下单，享受立减优惠！</p>
                        <a href="{:url('Click/index',['id'=>$goods.goods_id,'coupon_id'=>$goods.coupon_id])}" target="_blank" rel="nofollow" class="buy-btn">
                            <div class="line line-l"><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>
                            <div class="line line-r"><i></i><i></i><i></i><i></i><i></i><i></i><i></i></div>
                            领券立减<em>{$goods['coupon_price']}</em>元
                        </a>
                    </div>
                </div>

                <div class="tags">
                    <div class="tag-list">
                        {volist name="tags" id="vo"}
                        <a  class="tag-item" href="{:url('So/index',array('wd'=>$vo))}">
                            {$vo}
                        </a>
                        {/volist}
                    </div>
                    <p class="coll"><i></i>按<em>Ctrl&nbsp;+&nbsp;D</em>加入收藏</p>
                </div>
            </div>
        </div>
    </div>
    <div class="wrapper-r">
        <div class="rel-zk-area" style="margin-top: 60px;">
            <p class="head">
                <span>最近浏览</span>
                <a  href="{:url('History/index')}" class="more-his">查看更多
                </a>
            </p>
            <div class="hot-zk-list clearfix swiper-container swiper-container-horizontal">
                <div style="transition-duration: 0ms; transform: translate3d(0px, 0px, 0px);" class="swiper-wrapper">
                    <div style="width: 262px;" class="swiper-slide swiper-slide-active">
                    {notempty name="hisGoods"}
                        {volist name="hisGoods" id="vo"}
                        <a class="zk-img-item" title="{$vo['title']}" href="{:url('Goods/index', ['id'=>$vo['goods_id']])}">
                            <img style="opacity: 1;" src="{:get_config('WEB_SITE_URL')}{:get_config('WEB_GOODS_BGIMG')}" class="lazy" data-original="{$vo['img']}" alt="{$vo['title']}">
                            <p class="fixed-bottom">即将失效</p>
                        </a>
                        {/volist}
                    {/notempty}  
                    </div>
                    
                </div>
            </div>
        </div>
    </div>
</div>
<div class="wrapper">
    <div class="rel-zk-area" style="margin-bottom: 30px;">
        <p class="head"><span>猜你喜欢</span></p>
        <div class="rel-zk-list clearfix">
            {volist name='likeGoods' id='vo'}
            <div class="zk-item">
            <div class="img-area">
                
                    {$vo.start_time|new_goods}
                    <div class="lq">
                        <a href="{:url('Click/index',['id'=>$vo.goods_id,'coupon_id'=>$vo.coupon_id])}" target="_blank" rel="nofollow">
                        <div class="lq-t">
                            <p class="lq-t-d1">领优惠券</p>
                            <p class="lq-t-d2">省<span>{$vo['coupon_price']|format_number}</span>元</p>
                        </div>
                        <div class="lq-b"></div>
                        </a>
                    </div>
                    <div class="bottom-info">
                        <p class="time-count" data-endtime="{$vo['end_time']}"><i class="cate-icon">&#xe66b;</i></p>
                    </div>
                    <a href="{:url('Goods/index',array('id'=>$vo['goods_id']))}" target="_blank" title="{$vo['title']}">
                    <img alt="{$vo['title']}" data-original="{$vo['img']}" class="lazy" src="{:get_config('WEB_SITE_URL')}{:get_config('WEB_GOODS_BGIMG')}" style="opacity: 1;">
                    </a>
            </div>
            <p class="title-area elli">
                
                <span class="post-free">
                    包邮
                </span>
                
                {$vo['title']}
            </p>
            <div class="raw-price-area">现价：¥{$vo['price']|format_number}<p class="sold">已领 {$vo['coupon_receive']} 张券</p></div>
            <div class="info">
                <div class="price-area">
                    <span class="price">
                        ¥
                        <em class="number-font">
                            {$vo['discount_price']|format_number}
                        </em>
                        <i>
                        </i>
                    </span>
                </div>
                <div class="buy-area">
                    <a href="{:url('Click/index',['id'=>$vo.goods_id,'coupon_id'=>$vo.coupon_id])}" target="_blank" rel="nofollow">
                        <span class="coupon-amount">
                            {switch name="$vo['shop_type']" }
                            {case value="B"}
                                去淘宝
                            {/case}
                            {case value="C"}
                                去天猫
                            {/case}
                            {/switch}
                        </span>
                        <span class="btn-title">火速领券</span>
                    </a>
                </div>
                <div class="platform-area">
                    {switch name="$vo['shop_type']"}
                    {case value="B"}
                        <img src="__STATIC__/images/platform_taobao.png">淘宝
                    {/case}F
                    {case value="C"}
                    <img src="__STATIC__/images/platform_tmall.png">天猫
                    {/case}
                    {/switch}
                </div>
            </div>
        </div>
            {/volist}
        </div>
    </div>
</div>
<script type="text/javascript">
$(function(){

    //浏览历史
    var goodsId = '{$goods.goods_id}';
    var hisGoodsIds = $.cookie('his_goods_ids') || '';
    hisGoodsIds = decodeURIComponent(hisGoodsIds);
    if(hisGoodsIds.indexOf(goodsId+',') >= 0){
        hisGoodsIds = hisGoodsIds.replace(goodsId+',','');
    }
    hisGoodsIds += '{$goods.goods_id}';
    hisGoodsIds = hisGoodsIds.split(',');
    if(hisGoodsIds.length > 20){
        hisGoodsIds = hisGoodsIds.splice(hisGoodsIds.length-20,20);
    }
    hisGoodsIds = hisGoodsIds.join(',')+',';
    var d = new Date();
    d.setTime(d.getTime()+(365*24*60*60*1000));
    $.cookie('his_goods_ids',hisGoodsIds,{
        path:'/',
        expires:d
    });


    var timeArea = $('#eventTimeStr');
    var endTime = $('#endTime').val()*1;
    setInterval(dateCountDown,1000);
    function dateCountDown(){
        var now = Math.floor(new Date().getTime()/1000)*1;
        if(now > endTime){
            timeArea.html('优惠券已失效');
        }else{
            var gap = endTime - now;
            var dd = Math.floor(gap/(60*60*24));
            var hh = Math.floor((gap-dd*60*60*24)/(60*60));
            var mm = Math.floor((gap-dd*60*60*24-hh*60*60)/60);
            var ss = gap-dd*60*60*24-hh*60*60-mm*60;
            var timeStr = '优惠券即将失效:&nbsp;'
                +(dd>0?'<em>'+dd+'</em>天':'')
                +(hh>0?'<em>'+hh+'</em>时':'')
                +(mm>0?'<em>'+mm+'</em>分':'')
                +(ss>=0?'<em>'+ss+'</em>秒':'');
            timeArea.html(timeStr);
        }
    }
});
</script>
{include file="common/foot"}
